<?php

namespace app\index\controller;
use app\commons\model\ActivityVideo as ActivityVideoModel;

class Activityvideo extends Main
{
    /**
     * 活动视频列表
     */
    public function index(ActivityVideoModel $activityVideo){
        $sale_id = $this->data['sale_id'];
        return jsonp($activityVideo->where('sale_id',$sale_id)->with(['sale','member'])->field(['title','id','path','user_id','sale_id'])->paginate(10,false,['query'=>request()->param()]));
    }

    /**
     * 删除视频
     */
    public function delete(){
        $id = $this->data['id'];
        return jsonp(ActivityVideoModel::destroy($id));
    }
}